Revert "tests: adjust float to 8bit regression test for new sRGB precision"
authorMassimo Valentini <mvalentini@src.gnome.org>
Fri, 24 Aug 2012 08:06:01 +0000 (10:06 +0200)
committerMassimo Valentini <mvalentini@src.gnome.org>
Tue, 20 Nov 2012 18:51:45 +0000 (19:51 +0100)
This reverts commit 2675787f341ce259f9abec3e326b5efece45ecbf.

the literal 0.3 assigned to a float is approximated to a number
slightly greater than 0.3 (3/10) ->

lrint ((0.3 + epsilon) * 255) == lrint (76.5 + 255 * epsilon) == 77

tests/float-to-8bit.c

index 0cd2b2c606e86cef46edef1dd89fe99cb1dcc3e0..b273008d5fc7bb0973cc2b6059cdcc90e587907c 100644 (file)
@@ -37,7 +37,7 @@ main (int    argc,
   {
   {
     float in[][4]   = {{ 0.21582, -0.55, -0.14, 1.0 }, {0.2, 0.3, 0.5, 0.6}, {0.0, 1.0, 2.0, 3.0}};
-    unsigned char out[][4]  = {{ 55, 0, 0, 255 }, {51,76,128,153}, {0,255,255,255}};
+    unsigned char out[][4]  = {{ 55, 0, 0, 255 }, {51,77,128,153}, {0,255,255,255}};
 
     CHECK_CONV("float -> u8 1", unsigned char,
         babl_format("R'G'B'A float"),
@@ -57,7 +57,7 @@ main (int    argc,
 
   {
     float in[][4]   = {{ 0.21582, -0.55, -0.14, 1.0 }, {0.2, 0.3, 0.5, 0.6}, {0.0, 1.0, 2.0, 3.0}};
-    unsigned char out[][4]  = {{ 55, 0, 0, 255 }, {51,76,128,153}, {0,255,255,255}};
+    unsigned char out[][4]  = {{ 55, 0, 0, 255 }, {51,77,128,153}, {0,255,255,255}};
 
     CHECK_CONV("float -> u8 3", unsigned char,
         babl_format("RGBA float"),